package com.baiyi.cloud.platform.eureka.client.controller;

import javax.annotation.Resource;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import com.netflix.appinfo.ApplicationInfoManager;


@RestController
public class TestController {
	
	@Resource
	private RestTemplate restTemplate ;
	
	@Resource
	private ApplicationInfoManager  applicationInfoManager ;

	@GetMapping("/hello")
	public String hello() {
		return "hello";
	}
	
	
	@GetMapping("/test")
	public String hello1() {
		
		ResponseEntity<String> result = restTemplate.getForEntity ("http://eureka-client/hello", String.class);
		return result.getBody();
	}

}
